Technical Field
The present invention relates to the field of embedded systems, and in particular, to a method and an apparatus for implementing automatic signal exchange between multiple CPU boards by using a data bus.
Related Art
With regard to an embedded system formed by two or more CPU boards, the CPU boards implement different functions, and the CPU boards exchange signals by using a data bus, so as to implement distributed computing and cooperative work, as shown in FIG. 1. To implement signal exchange between CPU boards, a common practice is that: during a software programming phase, a same data bus address is first allocated to an output signal and an input signal of the CPU boards that need to be exchanged, and the allocated address is written into programs of the CPU boards. Only when a data bus address of an output part is the same as a data bus address of an input part, correct signal exchange may be implemented. As shown in FIG. 2, both of an output signal Sig1 of a board 1 and an input signal Sig2 of a board 2 use a data bus address x, so as to implement signal exchange. In a process of developing an embedded system, signals and signal exchange are usually adjusted for multiple times (for example, adding, reducing, or changing an order), which requires a signal receiver and a signal sender to simultaneously modify a data bus address and requires recompilation of programs of CPU boards. In a complex system, there may be several tens of thousands signals being exchanged between boards, and an error would easily occur when data bus addresses are manually adjusted. Therefore, with regard to an embedded system formed by multiple CPU boards, how to conveniently and flexibly implement automatic exchange of signals between CPU boards by using a data bus is a challenge.